package com.echat.elocation.protocol.entity.receive;

import com.echat.elocation.protocol.entity.PackageMsg;

public class RegisterRespMsg extends PackageMsg {

    public static final byte SUCCESS = 0;
    public static final byte CAR_ALREADY_REGISTERED = 1;
    public static final byte CAR_NOT_FOUND = 2;
    public static final byte TERMINAL_ALREADY_REGISTERED = 3;
    public static final byte TERMINAL_NOT_FOUND = 4;

    // byte[0-1] 应答流水号(WORD) 对应的终端注册消息的流水号
    private int replyFlowId;
    /***
     * byte[2] 结果(BYTE) <br>
     * 0：成功<br>
     * 1：车辆已被注册<br>
     * 2：数据库中无该车辆<br>
     **/
    private int replyCode;
    // byte[3-x] 鉴权码(STRING) 只有在成功后才有该字段
    private String replyToken;

    public RegisterRespMsg(PackageMsg msg) {
        this.msgHeader = msg.getMsgHeader();
        this.msgBody = msg.getMsgBody();
        this.checkCode = msg.getCheckCode();
    }



    public int getReplyFlowId() {
        return replyFlowId;
    }

    public void setReplyFlowId(int replyFlowId) {
        this.replyFlowId = replyFlowId;
    }

    public int getReplyCode() {
        return replyCode;
    }

    public void setReplyCode(int replyCode) {
        this.replyCode = replyCode;
    }

    public String getReplyToken() {
        return replyToken;
    }

    public void setReplyToken(String replyToken) {
        this.replyToken = replyToken;
    }

    @Override
    public String toString() {
        return "RegisterRespMsg{" +
                "replyFlowId=" + replyFlowId +
                ", replyCode=" + replyCode +
                ", replyToken='" + replyToken + '\'' +
                '}';
    }
}
